/**
 * 延时执行uni的方法，并且提示内容.
 * @param {method}  
 */
export const setInterval = (method,methodData,title,time = 2000) => {
	const methodName = method + '';
	console.log(methodData)
	console.log(time)
 	if(title){
 		uni.showToast({
 			title: title,
 			duration: time
 		})
 		setInterval( ()=>{
 			uni[method](methodData)
 		},time);
 	}else{
		// console.log(uni.navigateTo);      
		// console.log(uni['navigateTo']);
		// console.log(uni[methodName]);
 		//uni['navigateTo'](methodData);
		uni.navigateTo(methodData);
 	}
 }
 
 
 
  export const invokeSetTimeout = function(method,methodData,title,time = 2000){
   	if(title){
   		uni.showToast({
   			title: title,
   			duration: time,
			mask : true
   		})
   		setTimeout( ()=>{
   			uni[method](methodData)
   		},time);
   	}else{
   		uni[method](methodData);
   	}
  	
  }
  
export default {
	setInterval,
	invokeSetTimeout
};
